package teshop.view;

import java.io.Serializable;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import teshop.domain.Movie;
import teshop.service.MovieService;


@Component("listMovies")
@Scope("conversation.access")
public class ListMovies implements Serializable {

	private static final long serialVersionUID = 6907480345479125029L;
	
	private List<Movie> movies;
	
	public ListMovies() {}

	@Autowired
	public ListMovies(MovieService movieService) {
		movies = movieService.findAll();
	}

	public List<Movie> getMovies() {
		return movies;
	}
	
	public void setMovies(List<Movie> movies) {
		this.movies = movies;
	}
}